#pragma once
#include <d3dx9.h>
#include "TwEngineDx.h"
#include <stdlib.h>
// the PARTICLE class
class cPARTICLE
{
public:
	cPARTICLE()
	{
		reset_particle();
	}

	void render_particle();
	void set_particle(float camx, float camy, float camz);
	void run_particle(float seconds);
	void reset_particle();

	bool active; 

protected:
	D3DXVECTOR3 position;
	D3DXVECTOR3 velocity;
	D3DXVECTOR3 acceleration;
	float radius;
	float lifespan;
	float life;
	D3DXMATRIX matRotateX;
	D3DXMATRIX matRotateY;
};




class sa_TwParticleEmission
{
public:
	sa_TwParticleEmission(void);
	~sa_TwParticleEmission(void);

	void InitGraphics();

	void InitRenderState();

	void InitLight();

	void Update();

	void Render();

	void Clear();

	void run_particles();
	
	void render_grid();


private:
	// PARTICLE particle;
	static const int PARTICLECOUNT = 300;
	cPARTICLE particle[PARTICLECOUNT]; 
	float camx, camy, camz;    // camera position

};
